
<script setup>
import { ref } from "vue"
// 1. 创建一个null ref数据
const h1Ref = ref(null)
const clickFn = () => {
  console.log(h1Ref.value)
  h1Ref.value.innerText = '我就是个h1'
}
</script>

<template>
  <div>
    <h1 ref="h1Ref">我是标题</h1>
    <button @click="clickFn">获取dom</button>
  </div>
</template>

